<template>
	<iframe :src="src" class="preview-file"></iframe>
</template>

<script setup>
import { ref, computed } from "vue"

const props = defineProps({
	fileList: {
		type: Array,
		required: true,
	},
	modelValue: {
		type: Number,
		default: 0,
	},
})
const emits = defineEmits(["update:modelValue"])

const current = computed({
	get() {
		return props.modelValue
	},
	set(val) {
		emits("update:modelValue", val)
	},
})

const url = ref("")
const src = computed(() => {
	return "/pdfjs/web/viewer.html?file=" + url.value
})
</script>

<style lang="scss" scoped>
.preview-file {
}
</style>
